<template>
	<el-card class="form-container">
		<el-form :model="advertLaunchDetail" label-width="100px">
			<el-form-item label="广告名称" prop="advertName">
				<el-input v-model="advertLaunchDetail.advertName" readonly></el-input>
			</el-form-item>
			<el-form-item label="投放位置" prop="advertLaunchPosition">
				<el-radio-group v-model="advertLaunchDetail.advertLaunchPosition">
					<el-radio :label="1" >PC首页轮播图</el-radio>
					<el-radio :label="2" >APP首页轮播图</el-radio>
				</el-radio-group>
			</el-form-item>
			<el-form-item label="投放类型" prop="advertLaunchType">
				<el-radio-group v-model="advertLaunchDetail.advertLaunchType">
					<el-radio :label="1">PC(外链)</el-radio>
					<el-radio :label="2">APP(内链)</el-radio>
					<el-radio :label="3">H5(外链)</el-radio>
				</el-radio-group>
			</el-form-item>
			<el-form-item label="广告类型" prop="advertType">
				<el-radio-group v-model="advertLaunchDetail.advertType">
					<el-radio :label="1">活动</el-radio>
					<el-radio :label="2">商品</el-radio>
					<el-radio :label="3">商铺</el-radio>
				</el-radio-group>
			</el-form-item>
			<el-form-item label="广告状态" prop="advertStatus">
				<el-select v-model="advertLaunchDetail.advertStatus" class="input-width" placeholder="全部" >
					<el-option v-for="item in advertStatusOptions"
						:key="item.value"
						:label="item.label"
						:value="item.value">
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="广告链接地址" prop="advertUrl">
				<el-input v-model="advertLaunchDetail.advertUrl" readonly></el-input>
			</el-form-item>
			<el-form-item label="广告图片地址" prop="advertImage">
				<img v-if="advertLaunchDetail.advertImage" :src="advertLaunchDetail.advertImage" class="avatar">
				<i v-else class="el-icon-plus avatar-uploader-icon"></i>
			</el-form-item>
			<el-form-item label="开始时间" prop="advertLaunchStartTime">
				<el-input v-model="advertLaunchDetail.advertLaunchStartTime" readonly></el-input>
			</el-form-item>
			<el-form-item label="结束时间" prop="advertLanuchEndTime">
				<el-input v-model="advertLaunchDetail.advertLanuchEndTime" readonly></el-input>
			</el-form-item>
			<el-form-item label="归属类型" prop="advertAttributionType">
				<el-input v-model="advertLaunchDetail.advertAttributionType" readonly></el-input>
			</el-form-item>
			<el-form-item label="发放来源" prop="advertAttributionLogo">
				<el-input v-model="advertLaunchDetail.advertAttributionLogo" readonly></el-input>
			</el-form-item>
			<el-form-item label="广告描述" prop="advertDesc">
				<el-input type="textarea" v-model="advertLaunchDetail.advertDesc" readonly></el-input>
			</el-form-item>
			<el-form-item>
				<el-button @click="close">关闭</el-button>
			</el-form-item>
		</el-form>
	</el-card>
</template>

<script>
	import {
		findAdvertLaunchDetail
	} from '@/api/activity/advertLaunch'
	export default {
		name: 'view-advertLaunch',
		data() {
			return {
				advertLaunchDetail: {},
				advertStatusOptions: [
					{
						label: '未开始',
						value: 1
					},
					{
						label: '生效中',
						value: 2
					},
					{
						label: '已过期',
						value: 3
					},
				],
			}
		},
		created() {
			this.view(this.$route.query.id)
		},
		methods: {
			view(val) {
				findAdvertLaunchDetail(val).then(res => {
					this.advertLaunchDetail = res.data.responseData
				})
			},
			close() {
				this.$router.go(-1)
			}
		}
	}
</script>

<style>
</style>
